package com.danbay.cloud.account.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author SJG
 *         2018/1/9.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PermissionGroupDto {

    /**
     * 组名
     */
    @NotNull(message = "组名不能为空")
    private String name;
    /**
     * 描述
     */
    private String description;
    /**
     * 父级组id，根节点为0
     */
    @NotNull(message = "父级组id不能为空")
    private Integer parentId;

    /**
     * 权限id，用,分隔
     */
    @NotNull(message = "权限id不能为空")
    @Pattern(regexp = "^([\\d]+)?([\\d]+,)*([\\d]+)?$",message = "权限id格式不正确,应如:1,2,3")
    private String permissionIds;
}
